<template>
    <div class="ReportDetails">
        <mt-header fixed title="审核举报详情">
            <mt-button icon="back" @click="back" slot="left"></mt-button>
        </mt-header>
        <mt-tab-container style="margin-top: 40px;" >
            <mt-tab-container-item>
                <a class="mint-cell" style="padding: 10px;">
                    <div class="mint-cell-left"></div>
                    <div class="mint-cell-wrapper">
                        <div class="mint-cell-title mint-cell-label-font">
                            <span class="mint-cell-text">举报内容:{{listdata.content}}</span>

                            <span class="mint-cell-label">举报人昵称:{{listdata.nickname}}</span>
                            <span class="mint-cell-label">举报人手机号:{{listdata.mobile}}</span>
                            <span class="mint-cell-label">举报人名称:{{listdata.userName}}</span>
                            <span class="mint-cell-label">举报人名称:{{listdata.userName}}</span>



                            <span class="mint-cell-label">被举报人昵称:{{listdata.complaintName}}</span>
                            <span class="mint-cell-label">被举报人手机号:{{listdata.complaintMobile}}</span>
                            <span class="mint-cell-label">被举报人名称:{{listdata.complaintUserName}}</span>


                        </div>


                    </div>
                    <div class="mint-cell-wrapper" style=" margin-top: 10px;">
                        <div v-for="srcUrl in listdata.images" style="width: 100%;">
                            <img  style="width: 100%" :src="srcUrl" />
                        </div>
                    </div>
                    <div class="mint-cell-right"></div>
                    <div class="mint-cell-value" @click="deleteReport(listdata.complaintId,1)" style="margin:10px;">
                        <button class="mint-button mint-button--primary mint-button--large">
                            <label class="mint-button-text">属实</label></button>
                    </div>
                    <div class="mint-cell-value" @click="deleteReport(listdata.complaintId,2)" style="margin:10px;">
                        <button class="mint-button mint-button--danger mint-button--large">
                            <label class="mint-button-text">驳回</label></button>
                    </div>
                  </a>
            </mt-tab-container-item>

        </mt-tab-container>
    </div>
</template>

<script>
    import {
            complaintlist,
            complaint,
            loading,
            back,
    } from '../common/api/api';
    import { Toast ,Indicator} from 'mint-ui';
    export default {
        name: 'ReportDetails',
        data () {
            return {
                articles:[],
                createDialog: {
                    opened: false,
                    loading: false
                },
                listdata : this.$route.query.listdata,
                reportList : [],
            }
        },
        components: {
            //Hello
        },
        methods: {
            back : back,
            deleteReport: function (complaintId,status) {
                var vm = this;
                const params = {
                    complaintId : complaintId,
                    status : status
                }
                loading(true);
                complaint(params, {
                    target: vm.createDialog
                })
                        .then((data) => {
                    console.log(data);
                vm.createDialog.opened = false;
                if(data.errno == 0){
                    loading(false);
                    //vm.initData();
                    back();
                    Toast('操作成功');
                }else{
                    loading(false);
                    Toast(data.errmsg);
                }

//                  vm.$router.push({
//                      name: "UserOrder",
//                      params: { handleId: 1 }
//                  });
            });
            },
            initData : function () {
                var vm = this;
                console.log(vm.listdata);
                vm.listdata = vm.listdata;
            }
        },
        created() {
            this.initData()
        },
    }
</script>
